* The 'BeforeWatchlist' hook has been removed due to internal changes in
Special:Watchlist. 'SpecialWatchlistQuery' should now be used by extensions
to customize the watchlist database query.
-
+* Added $wgNewPasswordExpiry, to specify an expiry time (in seconds) to
+ tempoary passwords
=== Migrated extensions ===
The following extensions are migrated into MediaWiki 1.14:
* Image moving is now enabled for sysops by default
* Make "Did you mean" search feature more noticeable
* Added "Advanced search" link to the search form
+* (bug 2242) Add an expiry time to temporary passwords
=== Bug fixes in 1.14 ===
*/
$wgPasswordReminderResendTime = 24;
+/**
+ * The time, in seconds, when an emailed temporary password expires.
+ */
+$wgNewPasswordExpiry = 3600 * 24 * 7;
+
/**
* SMTP Mode
* For using a direct (authenticated) SMTP server connection.
* @return \bool True if matches, false otherwise
*/
function checkTemporaryPassword( $plaintext ) {
- return self::comparePasswords( $this->mNewpassword, $plaintext, $this->getId() );
+ if( self::comparePasswords( $this->mNewpassword, $plaintext, $this->getId() ) ) {
+ $this->load();
+ $expiry = wfTimestamp( TS_UNIX, $this->mNewpassTime ) + $wgNewPasswordExpiry;
+ return ( time() < $expiry );
+ } else {
+ return false;
+ }
}
/**
* @private
*/
function mailPasswordInternal( $u, $throttle = true, $emailTitle = 'passwordremindertitle', $emailText = 'passwordremindertext' ) {
- global $wgServer, $wgScript, $wgUser;
+ global $wgServer, $wgScript, $wgUser, $wgNewPasswordExpiry;
if ( '' == $u->getEmail() ) {
return new WikiError( wfMsg( 'noemail', $u->getName() ) );
$u->setNewpassword( $np, $throttle );
$u->saveSettings();
- $m = wfMsg( $emailText, $ip, $u->getName(), $np, $wgServer . $wgScript );
+ $m = wfMsg( $emailText, $ip, $u->getName(), $np, $wgServer . $wgScript, round( $wgNewPasswordExpiry / 86400 ) );
$result = $u->sendMail( wfMsg( $emailTitle ), $m );
return $result;
password for {{SITENAME}} ($4). A temporary password for user
"$2" has been created and was set to "$3". If this was your
intent, you will need to log in and choose a new password now.
+Your temporary password will expire in {{PLURAL:$5|one day|$5 days}}.
If someone else made this request, or if you have remembered your password,
and you no longer wish to change it, you may ignore this message and